/* GUI CONVERTED from rwrorua.p (converter v1.75) Sat Aug 12 23:18:09 2000 */
/* rwrorua.p - Manufacturing lead time subroutine of Routing Cost Roll-up   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                      */
/* All rights reserved worldwide.  This is an unpublished work.             */
/*V8:ConvertMode=Maintenance                                                */
/*H1H4*/ /*V8:RunMode=Character,Windows                                     */
/* REVISION: 8.6E     LAST MODIFIED: 08/05/98   BY: *H1H4* Dana Tunstall    */
/* REVISION: 8.6E     LAST MODIFIED: 06/22/00   BY: *L102* Vandna Rohira    */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb              */


/*L102** {mfglobal.i} */


/*L102*/ {mfdeclre.i}

         define input parameter part as character no-undo.
         define input parameter site as character no-undo.
         define input parameter routing as character no-undo.
         define input parameter order-qty as decimal no-undo.
         define input parameter effective-date as date no-undo.
         define output parameter mfg-lead as integer no-undo.

         define new shared variable wo_recno as recid.
         define new shared variable eff_date as date.

         define variable mfg_lt as integer no-undo.
         define variable i as integer no-undo.

         define new shared temp-table temp-wo_mstr no-undo like wo_mstr
             use-index wo_nbr.
         define new shared temp-table temp-wr_route no-undo like wr_route
             use-index wr_lot.

         {mfdatev.i}

         eff_date = effective-date.

         create temp-wo_mstr.
         assign wo_part = part
                wo_site = site
            wo_rel_date = eff_date
            wo_due_date = ?
             wo_qty_ord = order-qty
             wo_routing = routing.

         wo_recno = recid(temp-wo_mstr).

         if wo_qty_ord = 0 then wo_qty_ord = 1.

         {gprun.i ""rwworlc.p""}
/*GUI*/ if global-beam-me-up then undo, leave.


/*L102*/ /* WO_REL_DATE IS ASSIGNED VALUE OF LOW_DATE SO THAT CALENDAR */
/*L102*/ /* REFERENCES ARE NOT CONSIDERED IN LEAD TIME CALCULATION     */

/*L102*/ wo_rel_date = low_date.
         {gprun.i ""rwworle.p""}
/*GUI*/ if global-beam-me-up then undo, leave.


         find temp-wo_mstr no-lock where recid(temp-wo_mstr) = wo_recno
         no-error.

         {mfwday.i wo_rel_date wo_due_date mfg-lead wo_site}
